473,438 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,438 software developers and data experts.

Exporting From Access to a Dbase iV. via Object. Fails with error The Microsoft Jet Database engine could not find the object

Hi,
I've a VB script that creates a Access object in a word doc.
Here is the full script.

It works for all but the Export. Which always fails with a 3011 error.
If I do the same in Access as a straight Macro or script it works.
Add it as an object and it won't work.
HELP.
Sub Sub1()
Dim ACC As Variant
Dim AccFileName, TableName As String

Set ACC = CreateObject("Access.Application")
AccFileName = "G:\Current_copy\ccdata.mdb"
TableName = "OUTLETSERVIC"
ACC.OpenCurrentDatabase (AccFileName)

' Delete Records - works well
ACC.DoCmd.RunSQL "DELETE * FROM OUTLETSERVIC WHERE ID <>"""";", 0
ACC.DoCmd.Close acTable, TableName
' End delete

'Import Records - works well
ACC.DoCmd.TransferText acImportDelim, "OUTLETSERVICE_csv_gz Import
Specification", TableName, "G:\Working Files\OUTLETSERVICE.txt", True,
""
ACC.DoCmd.Close acTable, TableName
'End Import

'
################################################## ########################
' This is the bit the stuff up!!!!!!!!!!!!!!!!!!
'Export to DBF - fails with error The Microsoft Jet Database engine
could not find the object OUTLETSERVIC
ACC.DoCmd.TransferDatabase acExport, "dBase IV", "G:\Working
Files\", acTable, "OUTLETSERVIC", "G:\Working Files", False
ACC.DoCmd.Close acTable, TableName
'End Export
'
################################################## #########################

' Close the Database
ACC.CloseCurrentDatabase

MsgBox "Finished"
End Sub

Nov 13 '05 #1
8 6965
On 27 Sep 2005 05:49:10 -0700, "chippy" <Ch************@gmail.com>
wrote:

Try it using foldernames and filenames that fit the 8.3 format
exclusively:
g:\work\test1.dbf

-Tom.

Hi,
I've a VB script that creates a Access object in a word doc.
Here is the full script.

It works for all but the Export. Which always fails with a 3011 error.
If I do the same in Access as a straight Macro or script it works.
Add it as an object and it won't work.
HELP.
Sub Sub1()
Dim ACC As Variant
Dim AccFileName, TableName As String

Set ACC = CreateObject("Access.Application")
AccFileName = "G:\Current_copy\ccdata.mdb"
TableName = "OUTLETSERVIC"
ACC.OpenCurrentDatabase (AccFileName)

' Delete Records - works well
ACC.DoCmd.RunSQL "DELETE * FROM OUTLETSERVIC WHERE ID <>"""";", 0
ACC.DoCmd.Close acTable, TableName
' End delete

'Import Records - works well
ACC.DoCmd.TransferText acImportDelim, "OUTLETSERVICE_csv_gz Import
Specification", TableName, "G:\Working Files\OUTLETSERVICE.txt", True,
""
ACC.DoCmd.Close acTable, TableName
'End Import

'
################################################# #########################
' This is the bit the stuff up!!!!!!!!!!!!!!!!!!
'Export to DBF - fails with error The Microsoft Jet Database engine
could not find the object OUTLETSERVIC
ACC.DoCmd.TransferDatabase acExport, "dBase IV", "G:\Working
Files\", acTable, "OUTLETSERVIC", "G:\Working Files", False
ACC.DoCmd.Close acTable, TableName
'End Export
'
################################################# ##########################

' Close the Database
ACC.CloseCurrentDatabase

MsgBox "Finished"
End Sub


Nov 13 '05 #2
Thanks, I'll give that a go. yet the code for import works well??

Nov 13 '05 #3
Renamed the code to the dos files names. ie "workin~1"
The problem continues.
I also tried to rename the access table to a short name (4 characters)
still no go.
Very annoying.
Tried it on Access 2000 and 2002

Nov 13 '05 #4

File names, Table names and field names are limited to 8 characters in
the DBF File format that Access uses. Nor can a file, table or Field
name have a space in it.
On 27 Sep 2005 05:49:10 -0700, "chippy" <Ch************@gmail.com>
wrote:
I've a VB script that creates a Access object in a word doc.
Here is the full script.
It works for all but the Export. Which always fails with a 3011 error.
If I do the same in Access as a straight Macro or script it works.
Add it as an object and it won't work.
HELP.
Sub Sub1()
Dim ACC As Variant
Dim AccFileName, TableName As String
Set ACC = CreateObject("Access.Application")
AccFileName = "G:\Current_copy\ccdata.mdb"
TableName = "OUTLETSERVIC"
ACC.OpenCurrentDatabase (AccFileName)
' Delete Records - works well
ACC.DoCmd.RunSQL "DELETE * FROM OUTLETSERVIC WHERE ID <>"""";", 0
ACC.DoCmd.Close acTable, TableName
' End delete
'Import Records - works well
ACC.DoCmd.TransferText acImportDelim, "OUTLETSERVICE_csv_gz Import
Specification", TableName, "G:\Working Files\OUTLETSERVICE.txt", True,
""
ACC.DoCmd.Close acTable, TableName
'End Import
'
################################################# #########################
' This is the bit the stuff up!!!!!!!!!!!!!!!!!!
'Export to DBF - fails with error The Microsoft Jet Database engine
could not find the object OUTLETSERVIC
ACC.DoCmd.TransferDatabase acExport, "dBase IV", "G:\Working
Files\", acTable, "OUTLETSERVIC", "G:\Working Files", False
ACC.DoCmd.Close acTable, TableName
'End Export
'
################################################# ##########################
' Close the Database
ACC.CloseCurrentDatabase
MsgBox "Finished"
End Sub

--
Drive C: Error. (A)bort (R)etry (S)mack The Darned Thing

Nov 13 '05 #5
"chippy" <Ch************@gmail.com> wrote in
news:11**********************@g49g2000cwa.googlegr oups.com:
' This is the bit the stuff up!!!!!!!!!!!!!!!!!!
'Export to DBF - fails with error The Microsoft Jet Database
engine
could not find the object OUTLETSERVIC
ACC.DoCmd.TransferDatabase acExport, "dBase IV", "G:\Working
Files\", acTable, "OUTLETSERVIC", "G:\Working Files", False


Don't you need to provide the appropriate filename with extension
for the next-to-the-last argument? I just tested it, and the path
should be the 3rd argument, and the filename the one where you just
repeat the path again.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #6
Whats annoying is that the code works fine as is if a sub inside access
itself.
If you leave the 3rd argumant as a path it creates a default named
dbase.
Anyway
I tried, renaming all tables, and folders etc to < 8 characters but it
still fails the same way.:
*
ACC.DoCmd.TransferDatabase acExport, "dBase IV", "C:\data\work\",
acTable, "mytable", "C:\data\Work\cdata.dbf", False

I also tried exporting a paradox still same error.
*
I was successful in trying to export as a Access database but this is
not what I need.
Very anoying

Nov 13 '05 #7
"chippy" <Ch************@gmail.com> wrote in
news:11**********************@g47g2000cwa.googlegr oups.com:
Whats annoying is that the code works fine as is if a sub inside
access itself.
If you leave the 3rd argumant as a path it creates a default named
dbase.
Anyway
I tried, renaming all tables, and folders etc to < 8 characters
but it still fails the same way.:
*
ACC.DoCmd.TransferDatabase acExport, "dBase IV", "C:\data\work\",
acTable, "mytable", "C:\data\Work\cdata.dbf", False
"C:\data\Work\cdata.dbf" should be "cdata.dbf". You provide the path
in the 3rd argument and the filename in the 6th.
I also tried exporting a paradox still same error.
*
I was successful in trying to export as a Access database but this
is not what I need.
Very anoying


This should work:

ACC.DoCmd.TransferDatabase acExport, "dBase IV", "C:\data\work\",
acTable, "mytable", "cdata.dbf", False

If it doesn't, then I don't know what the issue is.

The reason things are different for Access MDBs and for DBF files is
that Access puts multiple tables in a single MDB file, whereas in
DBF, it's one table per file.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #8
Thanks davis for your help. Still can't make it work as an object in
word so have made it launch access and export. This works and the code
is identical without the Object call, I just copied my code in.
Must be a bug with access objects.

Nov 13 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

64
by: John | last post by:
Hi What future does access have after the release of vs 2005/sql 2005? MS doesn't seem to have done anything major with access lately and presumably hoping that everyone migrates to vs/sql. ...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
3
by: Rob Hughes | last post by:
(This is a crosspost from .data for greater exposure) I am writing an external app that utilizes. The app needs to be able to run repeatedly, but I am having a problem because Access will not...
13
by: royaltiger | last post by:
I am trying to copy the inventory database in Building Access Applications by John L Viescas but when i try to run the database i get an error in the orders form when i click on the allocate...
5
by: samadams_2006 | last post by:
I'm having a problem in accessing a Microsoft Access Database in a VB.NET Web Application. It's so straight forward, I thought I'd walk you through all the details here: 1) I have a .NET Web...
6
by: venmore | last post by:
Hi Can someone please point in the right direction. I have an XML file that gets updated every 4 hours on a web server. I can check the XML modification time in ASP and compare to the databse....
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
2
by: bcbrock | last post by:
I am trying to figure out how to query some data out of a dbase IV (.dbf) file sitting on a remote server from my MySQL/PHP/Web Server. Both servers are Windows Server 2003 SP2. My...
3
by: cvalle | last post by:
A little about me... I’ve build a few Access dbases but I consider myself a novice. I have never inherited someone else’s Dbase. The dbase is not password protected, but I cannot access all of the...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.